package it.asvp.asvp_portal.web.bean;

import it.asvp.asvp_portal.asvp_util.enumerative.Role;
import it.asvp.asvp_portal.asvp_util.enumerative.Sex;
import it.asvp.asvp_portal.data.entity.domain.Address;
import it.asvp.asvp_portal.data.entity.member.Member;
import it.asvp.asvp_portal.data.entity.member.MemberAccount;

public class MemberAccountBean {

	private Member member;
	private MemberAccount memberAccount;
	Address address;
	private String[] roles;
	private String[] sex;
	
	public Member getMember() {
		return member;
	}
	public void setMember(Member member) {
		this.member = member;
	}
	public MemberAccount getMemberAccount() {
		return memberAccount;
	}
	public void setMemberAccount(MemberAccount memberAccount) {
		this.memberAccount = memberAccount;
	}

	public String[] getRoles(Role role) {
		
		Role[] allRoles=Role.subRoles(role);
		roles=new String[allRoles.length];
		for(int i=0;i<allRoles.length;i++){
			this.roles[i]=allRoles[i].getName();
		}
		return roles;
	}
	public void setRoles(String[] roles) {
		this.roles = roles;
	}
	
	public String[] getAllSex(){
		
		Sex[] allSex=Sex.allSex();
		sex=new String[allSex.length];
		for(int i=0;i<allSex.length;i++){
			this.sex[i]=allSex[i].getName();
		}
		return sex;
	}
	
	public Address getAddress() {
		return address;
	}
	public void setAddress(Address address) {
		this.address = address;
	}
	
}
